<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
     "http://www.w3.org/TR/html4/frameset.dtd">
<!--*MT*
    
    MediaTomb - http://www.mediatomb.cc/
    
    index.html - this file is part of MediaTomb.
    
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
    
    Copyright (C) 2006-2010 Gena Batyan <bgeradz@mediatomb.cc>,
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
                            Leonhard Wimmer <leo@mediatomb.cc>
    
    MediaTomb is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2
    as published by the Free Software Foundation.
    
    MediaTomb is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    version 2 along with MediaTomb; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
    
    $Id: index.html 2081 2010-03-23 20:18:00Z lww $
-->
  <html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>MEDIATOMB</title>
        <link rel="shortcut icon" href="/favicon.ico" type="image/ico"> 
        <script type="text/javascript" language="JavaScript" src="/js/tools.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/icons.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/md5.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/auth.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/prototype.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/nanotree.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/tree.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/items.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/autoscan.js"></script>
        <script type="text/javascript" language="JavaScript" src="/js/tasks.js"></script>
        <script type="text/javascript" language="JavaScript">
            <!--
            var SID;      // session id
            var TYPE;     // database or filesystem
            var ACCOUNTS; // accounts enabled or disabled
            var LOGGED_IN;// logged in?
                          // is set by checkSID();
            var loggedIn = false;
            var isMSIE = /MSIE/.test(navigator.userAgent);
            if (isMSIE)
            {
                var msieWarn = getCookie("MSIEwarn");
                if (msieWarn != "ok")
                {
                    setCookie("MSIEwarn", "ok");
                    alert('MediaTomb UI is very limited with Internet Explorer and some elements will be displayed incorrectly! Please see the section "Internet Explorer" in the README file.');
                }
            }
            function init() {
                Try.these
                (
                    function()
                    {
                        TYPE = getCookie("TYPE");
                        SID = getCookie("SID");
                        lastNodeDbWish = getCookie("lastNodeDb");
                        lastNodeFsWish = getCookie("lastNodeFs");
                        var cookieViewItems = getCookie("viewItems");
                        if (cookieViewItems)
                            viewItems = cookieViewItems;
                    },
                    function()
                    {
                        alert("getCookie-Fehler");
                    }
                );
                if (TYPE!="db" && TYPE!="fs") TYPE="db";
                
                //if (SID && SID != null && SID != 'null')
                getConfig();    
                checkSID();
                var topDocument = frames["topF"].document;
                var rightDocument = frames["rightF"].document;
                var leftDocument = frames["leftF"].document;
                
                /*
                var logoutLinkEl = topDocument.getElementById("logout_link");
                if (ACCOUNTS)
                    Element.show(logoutLinkEl);
                else
                    Element.hide(logoutLinkEl);
                */
                    
                if (!SID || SID == null || ! LOGGED_IN)
                {
                    Element.show(rightDocument.getElementById("loginDiv"));
                    Element.show(leftDocument.getElementById("leftLoginDiv"));
                }
                else
                {
                    loggedIn = true;
                    Element.show(topDocument.getElementById("topDiv"));
                    Element.show(leftDocument.getElementById("treeDiv"));
                    Element.show(frames["topleftF"].document.getElementById("db_fs_selector"));
                    Element.show(topDocument.getElementById("statusDiv"));
                    if (ACCOUNTS)
                        Element.show(topDocument.getElementById("logout_link"));
                }
                var globalAjaxHandlers = {
                    onCreate: function()
                    {
                        setStatus("loading");
                    },
                    
                    onComplete: function()
                    {
                        if(Ajax.activeRequestCount < 0)
                            Ajax.activeRequestCount = 0;
                        if(Ajax.activeRequestCount == 0)
                        {
                            setStatus("idle");
                        }
                    },
                    
                    onException: function()
                    {
                        alert("MediaTomb cannot be reached! Please check if the server is still running.");
                        clearPollInterval();
                        if(Ajax.activeRequestCount < 0)
                            Ajax.activeRequestCount = 0;
                        if(Ajax.activeRequestCount == 0)
                        {
                            setStatus("idle");
                        }
                    }
                };
                if (loggedIn)
                    initLoggedIn();
                Ajax.Responders.register(globalAjaxHandlers);
            }
            
            function initLoggedIn()
            {
                itemInit();
                treeInit();
                Element.addClassName(frames["topleftF"].document.getElementById('type_' + TYPE), 'selected');
                
                frames["rightF"].document.onkeypress=userActivity;
                frames["rightF"].document.onmousedown = mouseDownHandler;
                frames["topF"].document.onmousedown = mouseDownHandler;
                frames["topleftF"].document.onmousedown = mouseDownHandler;
                frames["toprightF"].document.onmousedown = mouseDownHandler;
            }
            
            function setType(tmpType)
            {
                var topLeftDocument = frames["topleftF"].document;
                var deselectedEl = topLeftDocument.getElementById('type_' + TYPE);
                var selectedEl = topLeftDocument.getElementById('type_' + tmpType);
                
                if (deselectedEl != selectedEl)
                {
                    Element.removeClassName(deselectedEl, 'selected');
                    Element.addClassName(selectedEl, 'selected');
                }
                //$('type_' + otherType).removeClassName('selected');
                //$('type_' + tmpType).addClassName('selected');
                //Element.addClassName('type_' + tmpType, 'selected');
                //Element.removeClassName('type_' + otherType, 'selected');
                TYPE = tmpType;
                setCookie("TYPE", TYPE);
                treeChangeType();
                itemChangeType();
                return undefined;
            }
            
            //-->
        </script>

    </head>
    <frameset frameborder="1" border="2" framespacing="2" bordercolor="#FFFFFF" rows="112px,*" onload="init();">
        <frame src="top.html" name="topF" frameborder="0" noresize>
        <frameset cols="30%,*" frameborder="1" border="2" framespacing="2" bordercolor="#FFFFFF">
            <frameset rows="40px,*"  frameborder="1" border="2" framespacing="2" bordercolor="#FFFFFF">
                <frame src="topleft.html" name="topleftF" frameborder="0" noresize>
                <frame src="left.html" name="leftF" frameborder="0" noresize>
            </frameset>
            <frameset rows="40px,*" frameborder="1" border="2" framespacing="2" bordercolor="#FFFFFF">
                <frame src="topright.html" name="toprightF" frameborder="0" noresize>
                <frame src="right.html" name="rightF" frameborder="0" noresize>
            </frameset>
        </frameset>
    </frameset>
</html>
